//
//  MAKSparseArray.h
//  MAKCommon
//
//  Created by zhuwh on 2020/3/30.
//  Copyright © 2020 mark. All rights reserved.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

@interface MAKSparseArray<__covariant ObjectType> : NSObject

@property (readonly) NSUInteger count;
- (ObjectType)objectAtIndex:(NSUInteger)index;
- (ObjectType)objectAtKey:(NSUInteger)key;
-(void)setObject:(ObjectType)anObject atKey:(NSUInteger)key;
- (void)removeObjectAtIndex:(NSUInteger)index;
- (void)removeObjectAtKey:(NSUInteger)key;
- (void)removeAllObjects;

-(void) sortedArray;
-(void) sortedArrayUsingSelector:(SEL)comparator;

-(NSInteger)getKeyWithIndex:(NSUInteger)index;
-(NSInteger)getIndexWithKey:(NSUInteger)key;
@end

NS_ASSUME_NONNULL_END
